<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCollectShopListTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('collect_shop_list', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');
            $table->unsignedInteger('userId')->default(0)->comment('用户ID');
            $table->tinyInteger('isCollect')->default(0)->comment('是否收藏  0-不收藏  1-收藏');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->index(['userId', 'shopId'], 'idx_userId_shopId');
            $table->comment   = '门店收藏列表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('collect_shop_list');
    }
}
